package com.by.controller;

import com.by.common.bean.ResultBean;
import com.by.common.controller.BaseController;
import com.by.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "客户分类")
@RestController
@RequestMapping("/api")
public class CategoryController extends BaseController {
    @Autowired
    CategoryService categoryService;
    /**
     * 客户分类列表
     * @return ResultBean
     */
    @ApiOperation("客户分类列表")
    @GetMapping("/category")
    public ResultBean query() {
        List list = categoryService.query();
        return success("客户分类列表", list);
    }
}
